home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / GNU / emacs18to19.lha / emacs18to19.el < prev    next >
Encoding:
Text File  |  1994-09-29  |  9.8 KB  |  230 lines

  1. ;;; emacs18to19.el          Version 1.0                         9/29/94
  2. ;;;
  3. ;;; Author:          James A. Bednar
  4. ;;; Internet email:  jbednar@cs.utexas.edu
  5. ;;; 
  6. ;;; 
  7. ;;; This GNU Emacs lisp file modifies most keybindings and some
  8. ;;; functions from GNUEmacs v18.58 to behave like those in GNUEmacs
  9. ;;; v19.  The changes enable a user to switch between v18 on the Amiga
  10. ;;; and v19 on Unix without confusion.  This is only an interim
  11. ;;; solution to the lack of a port of v19 to the Amiga; once that has
  12. ;;; been completed by someone, this file will be of historical
  13. ;;; interest only.  
  14. ;;; 
  15. ;;;
  16. ;;; Except as detailed in the charts below, all of the globally bound
  17. ;;; keys from Emacs v19 (for functions which are present in v18)
  18. ;;; should have identical keybindings.  Of course, there are many,
  19. ;;; many functions which have been added in v19, and those functions
  20. ;;; will not be available until a full port is done.  The good news is
  21. ;;; that nearly all of the most popular functions are also in v18,
  22. ;;; judging by whether they were put on the GNUEmacs reference card
  23. ;;; from v19 (from the file etc/refcard.tex).  The first table below
  24. ;;; lists the exceptions to this rule.
  25. ;;; 
  26. ;;; 
  27. ;;;                V19 features on RefCard not supported
  28. ;;;               ***************************************
  29. ;;; 
  30. ;;;   RefCard Section      Key         Status under v18.58
  31. ;;;  -------------------- ----------- ---------------------------------
  32. ;;;   Incremental Search   M-p         unbound, function not available
  33. ;;;   Incremental Search   M-n         unbound, function not available
  34. ;;;   Multiple Windows     C-x 4 C-o   unbound, function broken
  35. ;;;   Multiple Windows     C-x 4 r     unbound, function not available
  36. ;;;   Minibuffer           M-p         unbound, function not available
  37. ;;;   Minibuffer           M-n         unbound, function not available
  38. ;;;   Minibuffer           M-r         unbound, function not available
  39. ;;;   Minibuffer           M-s         unbound, function not available
  40. ;;;  -------------------- ----------- ---------------------------------
  41. ;;;
  42. ;;;
  43. ;;; There is also one keybinding on the reference card which remains 
  44. ;;; different from v19:
  45. ;;;
  46. ;;;
  47. ;;;          V19 features on RefCard with different keybindings
  48. ;;;         ****************************************************
  49. ;;; 
  50. ;;;   RefCardSection         Command                     v18     v19
  51. ;;;  ---------------------- --------------------------- ------- -------
  52. ;;;   Incremental Search     Exit incremental search     ESC     RET
  53. ;;;  ---------------------- --------------------------- ------- -------
  54. ;;;   
  55. ;;;
  56. ;;; Of the globally-bound functions which are not on the reference
  57. ;;; card, the ones whose keybindings remain different from v19 are
  58. ;;; listed in the table below.  Note that the statements which
  59. ;;; redefine keys not on the reference card have been marked with ##.
  60. ;;; Since I have not included any documentation other than the
  61. ;;; reference card, some people might want to comment these lines out
  62. ;;; if they find the binding of their favorite function to be
  63. ;;; mysteriously redefined.  
  64. ;;; 
  65. ;;;
  66. ;;;            Other V19 features with different keybindings
  67. ;;;           ***********************************************
  68. ;;; 
  69. ;;;   Command              v18                    v19
  70. ;;;  -------------------- ---------------------- ----------------------
  71. ;;;   digit-argument       M-0 through M-9        M-0   through M-9
  72. ;;;                                               C-0   through C-9
  73. ;;;                                               C-M-0 through C-M-9
  74. ;;;
  75. ;;;   negative-argument    M--                    M-- 
  76. ;;;                                               C--
  77. ;;;                                               C-M--
  78. ;;;  -------------------- ---------------------- ----------------------
  79. ;;;
  80. ;;;
  81. ;;; Note also that M-x ispell-region and M-x ispell-buffer work under
  82. ;;; Amiga GNU Emacs 18, but only if ISpell has been installed (from
  83. ;;; ispell-3.3LJR.LHA on AmiNet). 
  84. ;;;
  85. ;;; 
  86. ;;; 
  87. ;;; 
  88. ;;; 
  89. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  90. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  91. ;;; 
  92. ;;; 
  93. ;;;
  94. ;;; To use this file, place it somewhere in your emacs load path
  95. ;;; (e.g., in GNUEmacs:lisp) and add lines like the following two in
  96. ;;; your .emacs file:
  97. ;;; 
  98. ;;; ;; Modify keybindings for compatibility with Emacs v19:
  99. ;;; (load "emacs18to19")
  100. ;;; 
  101. ;;; You may want to use a byte-compiled version to reduce loading time.
  102. ;;; 
  103. ;;; This file may be redistributed freely as long as this notice 
  104. ;;; remains intact.  If you distribute modified versions of this 
  105. ;;; file, please document your changes and add your name to these
  106. ;;; comments.  If you discover a bug, or have added more keybindings
  107. ;;; or functions from v19, please email me at the above address.
  108. ;;; Note that the GNU functions are covered by the GNU General 
  109. ;;; Public License; see the included file COPYING for details.
  110. ;;; 
  111. ;;; Have fun!
  112. ;;;
  113. ;;; Jim
  114. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  115. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  116.  
  117. ;;
  118. ;;                      ADDED KEY BINDINGS 
  119. ;;
  120. ;;   These keys were unbound in v18, so these commands do not disturb
  121. ;;   any previous functionality.
  122. ;;
  123. (global-set-key   "\e{"        'backward-paragraph)
  124. (global-set-key   "\e}"        'forward-paragraph)
  125. (global-set-key   "\C-x3"      'split-window-horizontally)
  126. (global-set-key   "\e\C-r"     'isearch-backward-regexp)
  127. (global-set-key   "\C-x6}"     'enlarge-window-horizontally)   ; ##
  128. (global-set-key   "\C-x6{"     'shrink-window-horizontally)    ; ##
  129. (global-set-key   "\C-xXq"     'top-level)                     ; ##
  130. (global-set-key   "\C-xXq"     'top-level)                     ; ##
  131. ;;
  132. ;;                    MODIFIED KEY BINDINGS 
  133. ;;
  134. ;;   The bindings of these keys bindings changed from v18 to v19.
  135. ;;   These should be the only commands which no longer operate 
  136. ;;   using the same keys as they did in v18.
  137. ;;
  138. ;; 
  139. (global-set-key "\e$" 'ispell-word)  ;; Old binding was to 'spell-word
  140. ;
  141. (global-unset-key "\C-x\e")          ;; Old binding was to 'repeat-complex-command
  142. (global-unset-key "\C-xn")           ;; Old binding was to 'narrow-to-region  ##
  143. (global-unset-key "\C-xr")           ;; Old binding was to 'copy-rectangle-to-register
  144. (global-unset-key "\C-xa")           ;; Old binding was to 'append-to-buffer
  145. ;;
  146. ;;                   MORE ADDED KEY BINDINGS 
  147. ;;
  148. ;;   The bindings of these keys bindings changed from v18 to v19.
  149. ;;   In order to add these new bindings, the old ones for the keys in 
  150. ;;   the section Modified Key Bindings had to be changed.  Once those
  151. ;;   have been changed, the new bindings below can be added.
  152. ;;   For instance, C-x n becomes a prefix, allowing the new bindings
  153. ;;   of 'narrow-to-page, etc.
  154. ;;
  155. ;; 
  156. (global-set-key   "\C-x\e\e"   'repeat-complex-command)
  157. ;
  158. (global-set-key   "\C-xnn"     'narrow-to-region)              ; ##
  159. (global-set-key   "\C-xnp"     'narrow-to-page)                ; ##
  160. (global-set-key   "\C-xnw"     'widen)                         ; ##
  161. ;
  162. (global-set-key   "\C-xrr"     'copy-rectangle-to-register)
  163. (global-set-key   "\C-xrk"     'kill-rectangle)
  164. (global-set-key   "\C-xry"     'yank-rectangle)
  165. (global-set-key   "\C-xro"     'open-rectangle)
  166. (global-set-key   "\C-xrt"     'string-rectangle)              ; ##
  167. (global-set-key   "\C-xrc"     'clear-rectangle)               ; ##
  168. ;
  169. (global-set-key   "\C-xrs"     'copy-to-register)
  170. (global-set-key   "\C-xrx"     'copy-to-register)              ; ##
  171. (global-set-key   "\C-xri"     'insert-register)
  172. (global-set-key   "\C-xrg"     'insert-register)               ; ##
  173. (global-set-key   "\C-xr "     'point-to-register)
  174. (global-set-key   "\C-xrj"     'register-to-point)
  175. (global-set-key   "\C-xr\C-@"  'point-to-register)             ; ##
  176. (global-set-key   "\C-xr\C- "  'point-to-register)             ; ##
  177. ;;
  178. (global-set-key   "\C-xag"     'add-global-abbrev)
  179. (global-set-key   "\C-xal"     'add-mode-abbrev)
  180. (global-set-key   "\C-xa+"     'add-mode-abbrev)               ; ##
  181. (global-set-key   "\C-xa\C-a"  'add-mode-abbrev)               ; ##
  182. (global-set-key   "\C-xaig"    'inverse-add-global-abbrev)
  183. (global-set-key   "\C-xa-"     'inverse-add-global-abbrev)     ; ##
  184. (global-set-key   "\C-xail"    'inverse-add-mode-abbrev)
  185. (global-set-key   "\C-xae"     'expand-abbrev)
  186. (global-set-key   "\C-xa "     'expand-abbrev)                 ; ##
  187.  
  188.  
  189.  
  190. ;;
  191. ;; Functions imported from GNUEmacs 19:
  192. ;;
  193.  
  194. ;; Because the functions below don't load rect.el automatically,
  195. (load "rect")
  196. ;; If you don't use the rectangle functions, you may comment out
  197. ;; the above line to save a small amount of memory and reduce
  198. ;; loading time very slightly. 
  199.  
  200. ;;; From rect.el in the GNUEmacs v19.22 distribution (unmodified)
  201. ;;; I find this function to be extremely useful, so I had to have
  202. ;;; it...  No doubt there are many more that are similarly useful, but
  203. ;;; I have not had the inclination to include them. -- J.A.B.
  204. ;;;
  205. ;;;###autoload
  206. (defun string-rectangle (start end string)
  207.   "Insert STRING on each line of the region-rectangle, shifting text right.
  208. The left edge of the rectangle specifies the column for insertion.
  209. This command does not delete or overwrite any existing text.
  210.  
  211. Called from a program, takes three args; START, END and STRING."
  212.   (interactive "r\nsString rectangle: ")
  213.   (operate-on-rectangle 'string-rectangle-line start end nil)
  214.   (goto-char start))
  215.  
  216. (defun string-rectangle-line (startpos begextra endextra)
  217.   (let ((column (+ (current-column) begextra endextra)))
  218.     (goto-char startpos)
  219.     (let ((ocol (current-column)))
  220.       (skip-chars-forward " \t")
  221.       (setq column (+ column (- (current-column) ocol))))
  222.     (delete-region (point)
  223.            ;; Use skip-chars-backward's LIM argument to leave
  224.            ;; characters before STARTPOS undisturbed.
  225.                    (progn (skip-chars-backward " \t" startpos)
  226.               (point)))
  227.     (insert string)))
  228.  
  229. ;;; Material from v19 rect.el ends here
  230.